package com.dengqi.mymodule.activity.network.module;

import com.dengqi.mymodule.activity.network.bean.MemberBean;
import com.dengqi.mymodule.activity.network.bean.TotalNum_Lists;
import com.module.retrofit.bean.ResponseBean;
import com.dengqi.mymodule.activity.network.view.IGlobal;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.QueryMap;

/**
 * @Author: dengqi
 * @CreateDate: 2020-10-15 20:06
 * @Description: 会员模块：会员列表
 */
public interface MemberContract {

    interface MemberListView{
        String getBusId();
        String getShopId();
        String getAscShopId();
        String getKeyword();
        String getLevel();
        String getSource_(); //下划线防止getSource()与系统方法冲突
        String getTag_();
        String getConsumeMonth();
        String getConsumeCount();
        String getBirthStart();
        String getBirthEnd();
        void onTotalSize(int totalSize);
        void onMemberList(List<MemberBean.ListBean> result, boolean isLoadMore);
        void onResultError(boolean isLoadMore);
    }

    interface MemberDetailView{
        String getBusId();
        String getMemberId();
        void onMemberDetail(MemberBean.DetailBean result);

    }

    interface MemberInfoView{
        String getBusId();
        String getShopId();
        String getPhone();
        String getName_();
        String getSource_();
        String getLevel();
        String getCardNum();
        String getBirth();
        String getPid();
        String getCid();
        String getDid();
        String getAddress();
        String getRemark();
        String getTag_();
        String getGender();
        void onMemberInfo();

    }

    interface MemberLevelListView{
        String getBusId();
        String getShopId();
        void onMemberLevelList(List<MemberBean.LevelListBean> result);

    }

    interface MemberTagListView{
        String getBusId();
        String getShopId();
        void onMemberTagList(List<MemberBean.TagListBean> result);

    }

    interface MemberSmsView{
        String getShopId();
        String getUids();
        String getMessage();
        void onMemberSms(Map<String, String> result);

    }

    interface MemberFilterView{
        void onMemberFilter(MemberBean.FilterBean result);

    }

    interface MemberInfoByPhoneView{
        String getShopId();
        String getBusId();
        String getPhone();
        void onMemberInfoByPhone(MemberBean.ListBean result);

    }

    interface Presenter{
        void getMemberList(MemberListView view, IGlobal iGlobal, boolean isLoadMore);
        void getMemberDetail(MemberDetailView view);
        void addMemberInfo(MemberInfoView view);
        void getMemberLevelList(MemberLevelListView view, boolean isShow);
        void getMemberTagList(MemberTagListView view, boolean isShow);
        void sendMemberSms(MemberSmsView view);
        void getMemberFilter(MemberFilterView view);
        void getMemberInfoByPhone(MemberInfoByPhoneView view);
    }

    interface Model{
        //获取会员列表
        @GET("https://api.900sui.cn/v1/bus/member/list")
        Observable<ResponseBean<TotalNum_Lists<MemberBean.ListBean>>> getMemberList(@QueryMap Map<String, String> params);

        //获取会员详情
        @GET("https://api.900sui.cn/v1/bus/member/detail")
        Observable<ResponseBean<MemberBean.DetailBean>> getMemberDetail(@QueryMap Map<String, String> params);

        //添加会员
        @FormUrlEncoded
        @POST("https://api.900sui.cn/v1/bus/member/add")
        Observable<ResponseBean<Map<String, String>>> addMemberInfo(@FieldMap Map<String, String> params);

        //获取会员等级列表
        @GET("https://api.900sui.cn/v1/bus/member/level/list")
        Observable<ResponseBean<List<MemberBean.LevelListBean>>> getMemberLevelList(@QueryMap Map<String, String> params);

        //获取会员标签列表
        @GET("https://api.900sui.cn/v1/bus/member/tag/list")
        Observable<ResponseBean<List<MemberBean.TagListBean>>> getMemberTagList(@QueryMap Map<String, String> params);

        //发送会员短信消息
        @GET("https://api.900sui.cn/v1/bus/member/sendMemberSms")
        Observable<ResponseBean<Map<String, String>>> sendMemberSms(@QueryMap Map<String, String> params);

        //获取筛选条件
        @GET("https://api.900sui.cn/v1/bus/member/getSearchCondition")
        Observable<ResponseBean<MemberBean.FilterBean>> getMemberFilter();

        //根据手机号获取会员信息
        @GET("https://api.900sui.cn/v1/bus/member/phone")
        Observable<ResponseBean<MemberBean.ListBean>> getMemberInfoByPhone(@QueryMap Map<String, String> params);


    }
}